﻿using MemberDal;
using MemberModel;

namespace MemberBll
{
    public class adminBll
    {
        public adminBll(adminDal dal)
        {
            Dal = dal;
        }

        public adminDal Dal { get; }

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="zhang">账号</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        public T_Admin GetAdmin(string zhang, string pwd)
        {
            try
            {
                T_Admin list = Dal.GetAdmin(zhang, pwd);
                return list;
            }
            catch (Exception)
            {
                throw;
            }
        }

        /// <summary>
        /// 显示会员登录列表
        /// </summary>
        /// <param name="name"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        public List<T_Admin> GetAdminInfo(string? name, int? age)
        {
            try
            {
                return Dal.GetAdminInfo(name, age);
            }
            catch (Exception)
            {
                throw;
            }
        }

        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="info">实体类</param>
        /// <returns></returns>
        public int PutAdminInfo(T_Admin info)
        {
            try
            {
                return Dal.PutAdminInfo(info);
            }
            catch (Exception)
            {
                throw;
            }
        }

        /// <summary>
        /// 反填数据
        /// </summary>
        /// <param name="aid"></param>
        /// <returns></returns>
        public T_Admin Fantian(int aid)
        {
            try
            {
               return Dal.Fantian(aid);

            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}